package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;
import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "RECOMMEND_GOODS")
public class RECOMMEND_GOODS extends Model {

	@Column(name = "shop_price")
	public String shop_price;

	@Column(name = "goods_name")
	public String goods_name;

	@Column(name = "goods_id")
	public int goods_id;

	@Column(name = "goods_thumb")
	public String goods_thumb;

	public static RECOMMEND_GOODS fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}

		RECOMMEND_GOODS localItem = new RECOMMEND_GOODS();

		localItem.goods_thumb = jsonObject.optString("goods_thumb");

		localItem.shop_price = jsonObject.optString("shop_price");

		localItem.goods_name = jsonObject.optString("goods_name");

		localItem.goods_id = jsonObject.optInt("goods_id");

		return localItem;
	}

}
